package com.example.sunran.auth;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;

import javax.ws.rs.ext.ContextResolver;

public class MyObjectMapperProvider implements ContextResolver<ObjectMapper> {

    static final ObjectMapper defaultObjectMapper;

    static {
        defaultObjectMapper = new ObjectMapper();
        defaultObjectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
    }
    @Override
    public ObjectMapper getContext(Class<?> aClass) {
        return defaultObjectMapper;
    }
}
